home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / templateLayer.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  2.4 KB  |  90 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. global proc templateLayer( string $state, int $setting )
  18. //
  19. // Alias|Wavefront Script File
  20. // MODIFY THIS AT YOUR OWN RISK
  21. //
  22. // Creation Date:    28 June 1996
  23. // Author:            jb
  24. //
  25. //
  26. //    Procedure Name:
  27. //        templateLayer
  28. //
  29. //    Description:
  30. //        This procedure queries the layer popup for the current
  31. //        layer, and templates/untemplates the members of that
  32. //        layer, or templates/untemplates the members of all layers,
  33. //        based on the arguments passed to the proc.
  34. //
  35. //    Input Arguments:
  36. //        $state, either -all or -active.
  37. //        $setting, either "0" or "1"
  38. //
  39. //    Return Value:
  40. //        None.
  41. //
  42. {
  43.     //
  44.     // Get the currently active "layer"
  45.     //
  46.     string $activeLayerName = `optionMenu -q -v layerPopup`;
  47.     
  48.     // If the layer is the universe, template/untemplate all
  49.     //
  50.     if ( $activeLayerName == "Universe" )
  51.         $state = "-all";
  52.  
  53.     switch( $state ) {
  54.  
  55.         case "-active":
  56.             // Template/untemplate the active 'layer'
  57.             //
  58.             toggle -template -state $setting $activeLayerName;
  59.  
  60.             break;
  61.  
  62.         case "-all":
  63.  
  64.             // Template/untemplate all the sets which are layers
  65.             //
  66.             string $allLayers[] = `listAllLayers`;
  67.             for( $item in $allLayers )
  68.             {
  69.                 toggle -template -state $setting $item;
  70.             }
  71.             break;
  72.  
  73.         case "-noncurrent":
  74.  
  75.             //
  76.             // Template/untemplate all the sets which are layers
  77.             // except for the current layer.
  78.             //
  79.             string $allLayers[] = `listAllLayers`;
  80.             for( $item in $allLayers )
  81.             {
  82.                 if( $item != $activeLayerName )
  83.                 {
  84.                     toggle -template -state $setting $item;
  85.                 }
  86.             }
  87.             break;
  88.     }
  89. }
  90.